#include <bits/stdc++.h>

using namespace std;

using ll = long long;
#define endl '\n'
const int maxn = 1e6 + 500;
int n;
int a[] = {10, 5, 4, 2, 1};
int dp[maxn];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n;
    for (int i = 1; i <= n; i++) dp[i] = i;
    for (int i = 0; i < 5; i++) dp[a[i]] = 1;
    for (int i = 1; i <= n; i++) {
        // dp[n]=MIN(dp[n-1]+1,dp[n-2]+1,dp[n-4]+1....dp[n-a[i]]+1)
        int &best = dp[i];
        if (i >= a[0]) best = min(best, dp[i - 10] + 1);
        if (i >= a[1]) best = min(best, dp[i - 5] + 1);
        if (i >= a[2]) best = min(best, dp[i - 4] + 1);
        if (i >= a[3]) best = min(best, dp[i - 2] + 1);
        if (i >= a[4]) best = min(best, dp[i - 1] + 1);
    }
    cout << dp[n] << endl;
    return 0;
}